<template>
  <el-select
    :model-value="modelValue"
    :placeholder="placeholder"
    :style="{ width }"
    @change="change"
  >
    <el-option v-for="item in Ops" :key="item.value" :label="item.label" :value="item.value" />
  </el-select>
</template>

<script>
  /** 业务组件-计划类型下拉选择器 */
  export default {
    name: 'PlanTypeSelector',
    components: {},
    inheritAttrs: false,
    props: {
      modelValue: {
        type: [Number, String],
        default() {
          return '';
        },
      },
      placeholder: {
        type: String,
        default: '请选择计划类型',
      },
      width: {
        type: String,
        default: '',
      },
    },
    emits: ['update:modelValue'],
    data() {
      return {
        Ops: [
          { label: '年度', value: 1 },
          { label: '月度', value: 2 },
          { label: '季度', value: 3 },
        ],
      };
    },
    methods: {
      change(val) {
        this.$emit('update:modelValue', val);
      },
    },
  };
</script>

<style lang="scss" scoped></style>
